/**
  @author: cilang
  @qq: 1019383856
  @bili: https://space.bilibili.com/433915419
  @gitee: https://gitee.com/OpencvLZG
  @github: https://github.com/OpencvLZG
  @since: 2023/9/22
  @desc: //TODO
**/

package util

import (
	"io/fs"
	"path/filepath"
)

func CountDirFiles(dirPath string) ([]string, error) {
	fileNames := make([]string, 0)
	err := filepath.Walk(dirPath, func(path string, info fs.FileInfo, err error) error {
		if err != nil {
			return err
		}
		if !info.IsDir() {
			fileNames = append(fileNames, info.Name())
		}
		return nil
	})
	if err != nil {

	}
	return fileNames, nil
}
